package com.cgx.tablet.beeper.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;


import com.cgx.tablet.beeper.R;
import com.cgx.tablet.beeper.adapter.viewholder.BizTransViewHolder;
import com.cgx.tablet.beeper.bean.BizTransBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2018/1/17.
 */

public class BizTransAdapter extends BaseRecycleViewAdapter<BizTransBean, BizTransViewHolder>{

    private OnItemClickListener onItemClickListener;
    private List<BizTransBean> bizTransBeans = new ArrayList<>();
    private LayoutInflater layoutInflater;

    public interface OnItemClickListener {
        void onItemClick(View view, int pos, List<BizTransBean> mData);
    }

    public BizTransAdapter(Context context, @NonNull List<BizTransBean> mData) {
        super(context, mData);
        layoutInflater = LayoutInflater.from(context);
        this.bizTransBeans = mData;
    }

    public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
        this.onItemClickListener = onItemClickListener;
    }

    @NonNull
    @Override
    public BizTransViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new BizTransViewHolder(layoutInflater.inflate(R.layout.item_biz_trans, parent, false), onItemClickListener, bizTransBeans);
    }
}

